package cn.stronglink.asset.module.dam.utils.dataJsonUtils.req.send;

import java.util.Scanner;

/**
 * 十六进制--转10进制
 *
 */
public class HexToTenUtil {

//	public static void main(String[] args) {
//		convertHexToAscII("31");
//	}

	public static String convertHexToAscII(String hex) {

		StringBuilder sb = new StringBuilder();

		for (int i = 0; i < hex.length() - 1; i += 2) {

			String output = hex.substring(i, (i + 2));
			// convert hex to decimal 49数字
			int decimal = Integer.parseInt(output, 16);
			// decimal to character 49数字---》对应asc 1
			sb.append((char) decimal);
		}
		return sb.toString();
	}

}
